use strict;
use warnings;

package JasPerl::PageContext::HeaderHash;
use parent qw(JasPerl::PageContext::HashSupport);

sub new {
    my ($class, $context, $values) = @_;
    bless { request => $context->get_request(), values => $values }, $class;
}

sub get {
    if ($_[0]->{values}) {
        return $_[0]->{request}->get_headers($_[1]);
    } else {
        return $_[0]->{request}->get_header($_[1]);
    }
}

sub keys {
    return $_[0]->{request}->get_header_names();
}

1;
